package FileDemo;

import java.io.File;
import java.io.IOException;

public class t1 {
    public static void main(String[] args) throws IOException {
        File f2 = new File("D:\\study\\999.java拓展\\自己敲代码-git\\javaBase\\homeExtendDay12\\src\\main\\java\\demo");
        delDirec(f2);
    }

    private static void delDirec(File fi) {
        File[] files = fi.listFiles();
        System.out.println(fi.getName());
        if (files != null) {
            for (File file : files) {
                if(file.isFile()){
                    file.delete();
                }else{
                    delDirec(file);
                }
            }
        }
        fi.delete();

    }
}
